{% extends "base.html" %}
{% load cms_tags %}
{% load i18n %}

{% block extrastyle %} {{ block.super }}
{% endblock %}

{% block extra_js %}
{{ block.super }}
{% if signupOnGoing %}
	<script src="{{ STATIC_URL }}js/jquery.eventsignup.js"></script>
	<script type="text/javascript">
	$(document).ready(function(){
		$('input').keypress(function(e) {
			if(e.which == 13) {
				$("#eventSignupForm_submit").click();
			}
		});
	});
	</script>
{% endif %}
{% endblock %}

{% block base_content %}
	<div class="container">
		{% include "component/event/event-breadcrumb-signup.html" %}
		<div class="row">
			<div class="col-md-12">
				<!-- content -->
				<div class="page-header">
					<h3 class="text-info">{{ event.name }}</h3>
				</div>
			</div>
		</div>
		{% include "component/event/event-info-signup.html" %}
		<div class="page-header">
		</div>
		{% if signupOnGoing %}
			<div class="row">
				<div class="col-md-12">
					<a id="importFromProfile" class="btn btn-info{% if not userHasProfile %} disabled{% endif %}"><i class="fa fa-share-square-o"></i> {% trans "Import from member profile" %}</a>
				</div>
			</div>
			<div class="row">
				<div class="col-md-12">
					{% include "component/event/event-signup-errormsg.html" %}
				</div>
			</div>
			<div class="row">
				<div class="col-md-12">
					<p class="text-muted"><small>{% trans "Followings are all required fields." %}</small></p>
					<form class="form" id="eventSignupForm" method="POST" role="form">
						{% csrf_token %}
						<fieldset>
							{% include "component/event/event-signup-form-fieldset.html" %}
						</fieldset>
					</form>
					{% include "component/event/event-signup-errormsg.html" %}
					<div class="form-group form-footer">
						<div class="controls">
							<a class="btn btn-success" id="eventSignupForm_submit">{% trans "Submit" %}</a>
							<a class="btn btn-default" href="/events/{{event.id}}/" style="margin-left:5px;">{% trans "Back to event description" %}</a>
						</div>
						<div class="progress progress-success progress-striped active">
							<div class="progress-bar" style="width: 100%;"></div>
						</div>
					</div>
				</div>
			</div>
		{% else %}
			<h4 class="text-danger"><i class="fa fa-ban"></i> {% trans "Signup have closed." %}</h4>
		{% endif %}
	</div>
	{% placeholder template_SingleEvent_content %}
{% endblock %}